<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
/**
 * 生成随机数
 * @param $len 长度;
 * @return string or null;
 */
function _rand_str($len){
    $str = "1234567890abcdefghjkminpqrstuvwxyz";
    $str_code = "";
    for($i = 0; $i < $len; $i++){
        $str_code .= $str[rand(0,strlen($str))];
    }
    return $str_code ? $str_code : null;
}